package com.cnhis.cloudhealth.clinical.clidoctor.clidoctor.service;

import java.util.Map;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

import javax.servlet.http.HttpServletRequest;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.dubbo.config.annotation.Service;
import com.cnhis.cloudhealth.clinical.clidoctor.clidoctor.bo.CliDoctorBo;
import com.cnhis.cloudhealth.clinical.clidoctor.clinewadvice.bo.CliNewAdviceBo;
import com.cnhis.cloudhealth.commons.Mappers.ModelVo;
import java.util.HashMap;

import com.cnhis.cloudhealth.rate.base.vac4.bo.Vac4Bo;
import com.cnhis.cloudhealth.rate.member.bo.MemberMangerBo;

@Service
public class CliDoctorImpl implements ICliDoctor
{
    @Autowired
    private CliDoctorBo cliDoctorBo;
    @Autowired
    private Vac4Bo vac4Bo;
    @Autowired
    private MemberMangerBo memberMangerBo;
    private static Lock locks = new ReentrantLock();
    Logger log = Logger.getLogger(CliDoctorImpl.class);
    
    @Override
    public ModelVo getDoctorPosition(Map map)
        throws Exception
    {
        return cliDoctorBo.getDoctorPosition(map);
    }

    @Override
    public ModelVo nurse_Lis_Bills_Print(HashMap map)
        throws Exception
    {
        return cliDoctorBo.exec_nurse_Lis_Bills_Print(map);
    }
    @SuppressWarnings("unchecked")
    @Override
    public ModelVo nurse_Lis_Bills_Print_batch_T(HashMap map)
        throws Exception
    {
        long l1 = System.currentTimeMillis();
            try
            {
                
                locks.lock();
                cliDoctorBo.insertCbw03();
                int cbw03 = cliDoctorBo.updateCbw03_(50);
                map.put("cbw03", cbw03);
            }
            finally
            {
                locks.unlock();
            } 
            long l2 = System.currentTimeMillis();
            long b =(l2-l1);
            log.info("----------------------------------------------生成条码耗时："+b+"毫秒------------------------------------------------------");
            ModelVo mv = new ModelVo();
            mv = cliDoctorBo.exec_nurse_Lis_Bills_Print_batch(map);
            return mv;
       
    }
    
    public ModelVo nurse_Lis_Bills_Print_batch(HashMap map)
        throws Exception
    {
            cliDoctorBo.insertCbw03();
            int cbw03 = cliDoctorBo.updateCbw03_(50);
            map.put("cbw03", cbw03);
            return cliDoctorBo.exec_nurse_Lis_Bills_Print_batch(map);
        
    }
    

    @Override
    public ModelVo getGeiyaoZhixing(HashMap map)
        throws Exception
    {
        return cliDoctorBo.getGeiyaoZhixing(map);
    }

    @Override
    public ModelVo getBce03(HashMap map)
        throws Exception
    {
        return cliDoctorBo.getBce03(map);
    }

	@Override
	public ModelVo horategetvaa03() throws Exception {
		return vac4Bo.updatehorategetvaa03();
	}

    @Override
    public ModelVo queryBce1Info(Map paramMap)
        throws Exception
    {
        return cliDoctorBo.queryBce1Info(paramMap);
    }

    @Override
    public ModelVo aab1()
        throws Exception
    {
        return cliDoctorBo.abb1();
    }

    @Override
    public ModelVo getYiyuanInfo()
        throws Exception
    {
        return cliDoctorBo.getYiyuanInfo();
    }

    @Override
    public ModelVo exec_CardCharge_Update(Map paramMap)
        throws Exception
    {
        return memberMangerBo.updatehoratecardcharge(paramMap);
    }

    @Override
    public ModelVo queryJibingByText(Map paramMap)
        throws Exception
    {
        return cliDoctorBo.queryJibingByText(paramMap);
    }

    @Override
    public ModelVo queryVac1ByVcb(Map paramMap)
        throws Exception
    {
        return cliDoctorBo.queryVac1ByVcb(paramMap);
    }

    @Override
    public ModelVo queryFileInfoByType(Map teMap)
        throws Exception
    {
        return cliDoctorBo.queryFileInfoByType(teMap);
    }

    @Override
    public ModelVo script817(Map paramMap)
        throws Exception
    {
        return cliDoctorBo.script817(paramMap);
    }

    @Override
    public ModelVo queryHasZj(Map teMap)
        throws Exception
    {
        return cliDoctorBo.queryHasZj(teMap);
    }

    @Override
    public ModelVo queryZjList(Map<String, Object> teMap)
        throws Exception
    {
        return cliDoctorBo.queryZjList(teMap);
    }

    @Override
    public ModelVo queryZhentaiConfig(Map<String, Object> teMap)
        throws Exception
    {
        return cliDoctorBo.queryZhentaiConfig(teMap);
    }

    @Override
    public ModelVo savePatientMore(Map<String, Object> teMap)
        throws Exception
    {
        return cliDoctorBo.savePatientMore(teMap);
    }

    @Override
    public ModelVo selecthuiyuanbingren(Map<String, Object> teMap, int currentPage, int pageSize)
        throws Exception
    {
        return cliDoctorBo.selecthuiyuanbingren(teMap, currentPage, pageSize);
    }

    @Override
    public ModelVo selectDataByScriptId1(HashMap map)
        throws Exception
    {
        return cliDoctorBo.selectDataByScriptId1(map);
    }

    @Override
    public ModelVo querybas02Bybce01(Map<String, Object> teMap)
        throws Exception
    {
        return cliDoctorBo.querybas02Bybce01(teMap);
    }

    @Override
    public ModelVo querybbx20Byvaf01(Map<String, Object> teMap)
        throws Exception
    {
        return cliDoctorBo.querybbx20Byvaf01(teMap);
    }

    @Override
    public ModelVo updateBas1_bce1(Map<String, Object> teMap)
        throws Exception
    {
        return cliDoctorBo.updateBas1_bce1(teMap);
    }

    @Override
    public ModelVo hujiao_houtai(HashMap hs)
        throws Exception
    {
        return cliDoctorBo.updateHujiao_houtai(hs);
    }

    @Override
    public ModelVo updateVaj1(Map<String, Object> teMap)
        throws Exception
    {
        return cliDoctorBo.updateVaj1(teMap);
    }

    @Override
    public ModelVo updateVaa15ByVac01(Map<String, Object> teMap)
        throws Exception
    {
        return cliDoctorBo.updateVaa15ByVac01(teMap);
    }

    @Override
    public ModelVo querySendZjByvac01(Map<String, Object> teMap)
        throws Exception
    {
        return cliDoctorBo.querySendZjByvac01(teMap);
    }

    @Override
    public ModelVo updateVajZjByvaj01(Map<String, Object> teMap)
        throws Exception
    {
        return cliDoctorBo.updateVajZjByvaj01(teMap);
    }

    @Override
    public ModelVo getIpAndMac(Map<String, Object> teMap, HttpServletRequest request)
        throws Exception
    {
        return cliDoctorBo.getIpAndMac(teMap,request);
    }

    @Override
    public ModelVo getHccode(HashMap map)
        throws Exception
    {
        return cliDoctorBo.getHccode(map);
    }

    @Override
    public ModelVo querySysTime()
        throws Exception
    {
        return cliDoctorBo.querySysTime();
    }

    @Override
    public String getParameter(Integer productId, Integer programId, Integer paramNo)
        throws Exception
    {
        return cliDoctorBo.getParameter(productId, programId, paramNo);
    }

    @Override
    public ModelVo queryBce1_vao1(Map<String, Object> teMap)
        throws Exception
    {
        return cliDoctorBo.queryBce1_vao1(teMap);
    }
    
    @Override
    public ModelVo updateBce01_vao1(Map<String, Object> teMap)
        throws Exception
    {
        return cliDoctorBo.updateBce01_vao1(teMap);
    }

    @Override
    public ModelVo queryFamilyRelation(Map<String, Object> teMap)
        throws Exception
    {
        return cliDoctorBo.queryFamilyRelation(teMap);
    }

    @Override
    public ModelVo updateBdj1ByBce01AndBbx01(Map<String, Object> teMap)
        throws Exception
    {
        return cliDoctorBo.updateBdj1ByBce01AndBbx01(teMap);
    }
    
    @Override
    public ModelVo deleteBdj1ByBce01AndBbx01(Map<String, Object> teMap)
        throws Exception
    {
        return cliDoctorBo.deleteBdj1ByBce01AndBbx01(teMap);
    }

    @Override
    public ModelVo queryAah1Bby1ByBce01(Map<String, Object> teMap)
        throws Exception
    {
        
        return cliDoctorBo.queryAah1Bby1ByBce01(teMap);
    }

    @Override
    public ModelVo queryEye1(Map<String, Object> teMap)
        throws Exception
    {
        return cliDoctorBo.queryEye1(teMap);
    }

    @Override
    public ModelVo saveEye1(Map<String, Object> teMap)
        throws Exception
    {
        return cliDoctorBo.saveEye1(teMap);
    }

    @Override
    public ModelVo updateEye1(Map<String, Object> teMap)
        throws Exception
    {
        return cliDoctorBo.updateEye1(teMap);
    }
    
}
